package com.itc.bi.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 态势模板
 * @TableName big_screen_page
 */
@TableName(value ="big_screen_page")
@Data
public class BigScreenPageEntity implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 态势名称
     */
    @ApiModelProperty("态势名称")
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 页面编码，唯一标识
     */
    @ApiModelProperty("页面编码，唯一标识")
    @NotBlank(message = "编码不能为空")
    private String code;

    /**
     * 封面图片(前端截图的形式更新到后端)
     */
    @ApiModelProperty("封面图片(前端截图的形式更新到后端)")
    @TableField(value = "cover_picture")
    private String coverPicture;

    /**
     * 页面类型
     */
    @ApiModelProperty("页面类型")
    private String type;

    /**
     * 是否发布(1:发布，0:未发布)
     */
    @ApiModelProperty("是否发布(1:发布，0:未发布)")
    @TableField(value = "is_publish")
    private Integer isPublish;

    /**
     * 所属目录
     */
    @ApiModelProperty("所属目录")
    @TableField(value = "parent_code")
    private String parentCode;

    @ApiModelProperty(value = "配置",hidden = true)
    @TableField(value = "config")
    private String config;

    @ApiModelProperty(value = "发布大屏编码",hidden = true)
    @TableField(value = "publish_code")
    private String publishCode;


    @ApiModelProperty("配置,前端数据传输")
    @TableField(exist = false)
    private JSONObject configObj;

    /**
     * 排序
     */
    @ApiModelProperty("排序")
    @TableField(value = "order_num")
    private Integer orderNum;

    /**
     * 席位清单
     */
    @ApiModelProperty("席位清单")
    @TableField(value = "seat_id")
    private String seatId;

    /**
     * 发布目录
     */
    @ApiModelProperty("发布目录")
    @TableField(value = "publish_dir")
    private String publishDir;

    /**
     * 排序
     */
    @ApiModelProperty("发布排序")
    @TableField(value = "publish_order")
    private Integer publishOrder;

    /**
     * 发布时间
     */
    @ApiModelProperty("发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date publishTime;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 更新人
     */
    @ApiModelProperty("更新人")
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "是否删除(1:删除，0:未删除)",hidden = true)
    @TableField(value = "is_deleted")
    @TableLogic
    private Integer isDeleted=0;
}